//
//  TopNavigationBar.swift
//  MyCloset
//
//  Created by 牟好好 on 2024/11/14.
//

import SwiftUI

struct TopNavigationBar: View {
    var title: String
    var action: () -> Void
    
    var body: some View {
        HStack {
            Text(title)
                .font(.system(size: 25, weight: .bold))
        }
        .frame(maxWidth: .infinity)
        .overlay(alignment: .leading) {
            Button(action: {
                action()
            }, label: {
                Image(systemName: "chevron.left")
                    .font(.system(size: 25))
            })
        }
        .padding(.horizontal)
        .foregroundStyle(.accent)
    }
}

#Preview {
    TopNavigationBar(title: "更改搭配") {}
}
